package core.cwm;

import java.util.ArrayList;
import java.util.List;

import core.sub.Company;

public class COI {

	private String name;
	
	private List<Company> companies; 

	public COI(String s) {
		name = s;
		companies = null;
	}

	public void add(Company C) {
		if(companies == null)
			companies = new ArrayList<Company>();
		if(!companies.contains(C))
			companies.add(C);
	}

	public void remove(Company C) {
		if(companies != null && C != null)
			companies.remove(C);
	}

	public boolean contains(Company C) {
		if(companies != null && C != null)
			return companies.contains(C);
		return false;
	}
	
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
	
	public List<Company> getCompanies() {
		return companies;
	}

}
